<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
<div id="app">
    <h1>{$sitename}</h1>
    <h1>{{message}}</h1>
    <div @click="getData" class="dianwo">dianwo</div>
</div>
</body>
<link href="/assets/admin/css/index.css" rel="stylesheet" type="text/css" />
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="https://cdn.bootcss.com/axios/0.19.0/axios.js"></script>
<script>
    var app = new Vue({
        el: '#app',
        data: {
            message: 'Hello Vue!'
        },
        methods: {
            getData(){
                axios.post('/api/index/getData', {
                }).then((response)=>{
                        this.message = response.data.name;
                    })
                    .catch(function (error) {
                        console.log(error);
                    });
            }
        },
        mounted:function(){
            this.getData();
         }

    })
</script>
</html>